package test;

/**
 * Created by admin on 2016/12/30.
 */
public class UrlParamReplace {
    public static void main(String[] args) {
        System.out.println(replaceAccessTokenReg("https://zb.51vv.com/user/room_123456.htm?vvid=777&vvshowid=953&haha=toto","vvshowid","111"));
    }
    public static String replaceAccessTokenReg(String url, String name, String accessToken) {
        url = url.replaceAll("(" + name +"=[^&]*)", name + "=" + accessToken);
        return url;
    }
}
